package com.ms.p2p.service.impl;


import com.ms.p2p.dao.PayMethodValueDao;
import com.ms.p2p.entity.system.PayMethodValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 支付方式
 */
@Service
public class PayMethodValueServiceImpl {

	@Autowired
	PayMethodValueDao payMethodValueDao;

//
	@CacheEvict(value = "paymethodValue", allEntries = true)
	public int update(PayMethodValue payMethodValue) {
		return payMethodValueDao.update(payMethodValue);
	}

	@Cacheable(value = "paymethodValue", key = "'ById'+#id")
	public List<PayMethodValue> findByPaymentId(String id) {
		return payMethodValueDao.findByPaymentId(id);
	}

	@Cacheable(value = "paymethodValue", key = "'ByName'+#name")
	public PayMethodValue findByName(String name) {
		return payMethodValueDao.findByPaymentName(name);
	}


}
